package org.ghost.akka.client;

import akka.event.Logging;
import akka.event.LoggingAdapter;
import org.ghost.akka.common.command.BaseCommand;
import org.ghost.akka.common.command.ICommandProcessHandler;

/**
 * AKKA 客户端代理
 */
public class AkkaClientProxy implements ICommandProcessHandler {

    private volatile static AkkaClientProxy instance = new AkkaClientProxy();
    private AkkaClientSystem delegate = new AkkaClientSystem();
    LoggingAdapter log = Logging.getLogger(delegate.getContext(), this);

    private AkkaClientProxy() {
    }

    public static AkkaClientProxy getInstance() {
        return instance;
    }

    @Override
    public void doProcess(BaseCommand cmd) {
        log.info("AkkaClientProxy doProcess before [taskId=" + cmd.getJob().getTaskId() + "]");
        delegate.doProcess(cmd);
    }

}
